package cn.iocoder.yudao.module.erp.dal.mysql.dpeast;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.dpitem.dpeastlistwlmq.vo.DpEastListWlmqPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.dplist.DpEastListWlmqDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 乌鲁木齐东线清单 Mapper
 *
 * @author 天使管理员
 */
@Mapper
public interface DpEastListWlmqMapper extends BaseMapperX<DpEastListWlmqDO> {

    default PageResult<DpEastListWlmqDO> selectPage(DpEastListWlmqPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DpEastListWlmqDO>()
                .eqIfPresent(DpEastListWlmqDO::getNo, reqVO.getNo())
                .eqIfPresent(DpEastListWlmqDO::getTicketNo, reqVO.getTicketNo())
                .eqIfPresent(DpEastListWlmqDO::getBoxMarking, reqVO.getBoxMarking())
                .likeIfPresent(DpEastListWlmqDO::getProductName, reqVO.getProductName())
                .eqIfPresent(DpEastListWlmqDO::getProductInfo, reqVO.getProductInfo())
                .eqIfPresent(DpEastListWlmqDO::getMaterialRu, reqVO.getMaterialRu())
                .eqIfPresent(DpEastListWlmqDO::getQuantity, reqVO.getQuantity())
                .eqIfPresent(DpEastListWlmqDO::getQuantityPerBox, reqVO.getQuantityPerBox())
                .eqIfPresent(DpEastListWlmqDO::getUnit, reqVO.getUnit())
                .eqIfPresent(DpEastListWlmqDO::getTotal, reqVO.getTotal())
                .eqIfPresent(DpEastListWlmqDO::getLength, reqVO.getLength())
                .eqIfPresent(DpEastListWlmqDO::getWidth, reqVO.getWidth())
                .eqIfPresent(DpEastListWlmqDO::getHigh, reqVO.getHigh())
                .eqIfPresent(DpEastListWlmqDO::getVolumePerBox, reqVO.getVolumePerBox())
                .eqIfPresent(DpEastListWlmqDO::getCubem, reqVO.getCubem())
                .eqIfPresent(DpEastListWlmqDO::getGrossWeightPerBox, reqVO.getGrossWeightPerBox())
                .eqIfPresent(DpEastListWlmqDO::getGrossWeight, reqVO.getGrossWeight())
                .eqIfPresent(DpEastListWlmqDO::getNetWeightBox, reqVO.getNetWeightBox())
                .eqIfPresent(DpEastListWlmqDO::getTotalNetWeight, reqVO.getTotalNetWeight())
                .eqIfPresent(DpEastListWlmqDO::getPackaging, reqVO.getPackaging())
                .eqIfPresent(DpEastListWlmqDO::getNotes, reqVO.getNotes())
                .orderByDesc(DpEastListWlmqDO::getId));
    }

    default List<DpEastListWlmqDO> selectListByNo(String no) {
        return selectList(DpEastListWlmqDO::getNo, no);
    }

    default int deleteByNo(String no) {
        return delete(DpEastListWlmqDO::getNo, no);
    }


}